﻿using System.Collections.Generic;
using Microsoft.Extensions.Configuration;

namespace OS.Common.Plugs.ConfigPlug
{
    /// <summary>
    /// 读取配置文件接口
    /// </summary>
    public interface IConfigPlug
    {
        /// <summary>
        /// 根据节点名称获取节点
        /// </summary>
        /// <param name="key">节点名称</param>
        /// <returns></returns>
        IConfigurationSection GetSection(string key);

        /// <summary>
        /// 获取配置文件节连接字符串
        /// </summary>
        /// <param name="name">连接字符串名称</param>
        /// <returns></returns>
        string GetConnectionString(string name);

        /// <summary>
        /// 获取配置文件子节点
        /// </summary>
        /// <returns></returns>
        IEnumerable<IConfigurationSection> GetChildren();
    }
}